#ifndef DBUSPATH_HPP
#define DBUSPATH_HPP

#include <QDialog>
#include <QtDBus>
#include "servicesproxymodel.h"
#include "common.hpp"
namespace Ui {
class DbusPath;
}

class DbusPath : public QDialog
{
    Q_OBJECT

public:
    explicit DbusPath(QDBusConnection bus,QWidget *parent = 0);
    ~DbusPath();

    QString getCurrentService() const;

    QString getCurrentPath() const;

    QString getCurrentInterface() const;

private slots:
    void serviceChanged(const QModelIndex &index);
    void on_buttonBox_accepted();

    void on_buttonBox_rejected();

    void pathChanged(const QModelIndex &index);
private:
    QDBusConnection m_bus;
    Ui::DbusPath *ui;

    QString currentService;
    QString currentPath;
    QString currentInterface;
    QStringListModel *servicesModel;
    ServicesProxyModel *servicesProxyModel;
};

#endif // DBUSPATH_HPP
